import cv2 as cv


def main():
    cap = cv.VideoCapture('../data/output.mp4')

    while cap.isOpened():
        ret, frame = cap.read()
        if not ret:
            print("没有帧了!")
            break

        gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
        cv.imshow('Press Q to exit', gray)

        if cv.waitKey(25) == ord('q'):
            break

    cap.release()
    cv.destroyAllWindows()


if __name__ == "__main__":
    main()
